function out = bandpass(x, fs, low, high)

N = 4;
wn = [(2*low)/fs (2*high)/fs];
[B, A] = butter(N, wn(1), 'high');
[B2, A2] = butter(N,wn(2));

out1 = zeros(size(x,1),size(x,2));
out = out1;

for i = 1:size(x,2)
out1(:,i) = filtfilt(B,A,x(:,i));
out(:,i) = filtfilt(B2, A2, out1(:,i));
end
